package utils

import (
	"fmt"
	"github.com/go-resty/resty/v2"
)

func HttpGet(url string, body interface{}) (interface{}, error) {
	client := resty.New()
	client.SetRootCertificate("./etc/es/http_ca.crt")
	resp, err := client.R().
		SetBody(body).
		SetBasicAuth("elastic", "qnSSY7s1rLpBCPzJCiRB").
		EnableTrace().
		Get(url)
	if err != nil {
		return nil, err
	}

	fmt.Println(resp)

	return nil, err
}
